package com.burstly.lib.component.networkcomponent.burstly;

import android.app.Activity;
import android.view.View;
import android.view.View.OnClickListener;
import com.burstly.lib.component.networkcomponent.burstly.html.CloseableContainer;

public class DefaultInterstitialDecorator
  implements BurstlyFullscreenActivity.IDecorator, View.OnClickListener
{
  private Activity mActivity;
  private final long mCloseButtonDelay;
  private IOverlayContainer mOverlay;

  public DefaultInterstitialDecorator()
  {
    this(0L);
  }

  public DefaultInterstitialDecorator(long paramLong)
  {
    this.mCloseButtonDelay = paramLong;
  }

  private View createContainer(View paramView, Activity paramActivity)
  {
    CloseableContainer localCloseableContainer = createContainer(paramActivity);
    localCloseableContainer.setShowCloseIndicator(true, "top-right");
    localCloseableContainer.putIntoContainer(paramView);
    localCloseableContainer.setCloseClickListener(this);
    localCloseableContainer.setShowCloseButtonDelay(this.mCloseButtonDelay);
    return localCloseableContainer;
  }

  protected <Z extends View> CloseableContainer<Z> createContainer(Activity paramActivity)
  {
    return new CloseableContainer(paramActivity);
  }

  public View decorate(View paramView, Activity paramActivity)
  {
    this.mActivity = paramActivity;
    return createContainer(paramView, paramActivity);
  }

  public View decorate(View paramView, IOverlayContainer paramIOverlayContainer)
  {
    this.mOverlay = paramIOverlayContainer;
    return createContainer(paramView, (Activity)paramView.getContext());
  }

  public void onClick(View paramView)
  {
    if (this.mOverlay != null)
    {
      this.mOverlay.hideOverlayed();
      this.mOverlay = null;
    }
    while (this.mActivity == null)
      return;
    this.mActivity.finish();
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.burstly.lib.component.networkcomponent.burstly.DefaultInterstitialDecorator
 * JD-Core Version:    0.6.2
 */